package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BankOpenMapper;
import com.ruoyi.system.domain.BankOpen;
import com.ruoyi.system.service.IBankOpenService;

/**
 * 银行开户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-23
 */
@Service
public class BankOpenServiceImpl implements IBankOpenService 
{
    @Autowired
    private BankOpenMapper bankOpenMapper;

    /**
     * 查询银行开户
     * 
     * @param bankOpenInfoId 银行开户主键
     * @return 银行开户
     */
    @Override
    public BankOpen selectBankOpenByBankOpenInfoId(Long bankOpenInfoId)
    {
        return bankOpenMapper.selectBankOpenByBankOpenInfoId(bankOpenInfoId);
    }

    /**
     * 查询银行开户列表
     * 
     * @param bankOpen 银行开户
     * @return 银行开户
     */
    @Override
    public List<BankOpen> selectBankOpenList(BankOpen bankOpen)
    {
        return bankOpenMapper.selectBankOpenList(bankOpen);
    }

    /**
     * 新增银行开户
     * 
     * @param bankOpen 银行开户
     * @return 结果
     */
    @Override
    public int insertBankOpen(BankOpen bankOpen)
    {
        bankOpen.setCreateTime(DateUtils.getNowDate());
        return bankOpenMapper.insertBankOpen(bankOpen);
    }

    /**
     * 修改银行开户
     * 
     * @param bankOpen 银行开户
     * @return 结果
     */
    @Override
    public int updateBankOpen(BankOpen bankOpen)
    {
        bankOpen.setUpdateTime(DateUtils.getNowDate());
        return bankOpenMapper.updateBankOpen(bankOpen);
    }

    /**
     * 批量删除银行开户
     * 
     * @param bankOpenInfoIds 需要删除的银行开户主键
     * @return 结果
     */
    @Override
    public int deleteBankOpenByBankOpenInfoIds(Long[] bankOpenInfoIds)
    {
        return bankOpenMapper.deleteBankOpenByBankOpenInfoIds(bankOpenInfoIds);
    }

    /**
     * 删除银行开户信息
     * 
     * @param bankOpenInfoId 银行开户主键
     * @return 结果
     */
    @Override
    public int deleteBankOpenByBankOpenInfoId(Long bankOpenInfoId)
    {
        return bankOpenMapper.deleteBankOpenByBankOpenInfoId(bankOpenInfoId);
    }
}
